/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.systemcar.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author danilo
 */
@Embeddable
public class PostoCombustivelPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_posto")
    private int idPosto;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_combustivel")
    private int idCombustivel;

    public PostoCombustivelPK() {
    }

    public PostoCombustivelPK(int idPosto, int idCombustivel) {
        this.idPosto = idPosto;
        this.idCombustivel = idCombustivel;
    }

    public int getIdPosto() {
        return idPosto;
    }

    public void setIdPosto(int idPosto) {
        this.idPosto = idPosto;
    }

    public int getIdCombustivel() {
        return idCombustivel;
    }

    public void setIdCombustivel(int idCombustivel) {
        this.idCombustivel = idCombustivel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idPosto;
        hash += (int) idCombustivel;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PostoCombustivelPK)) {
            return false;
        }
        PostoCombustivelPK other = (PostoCombustivelPK) object;
        if (this.idPosto != other.idPosto) {
            return false;
        }
        if (this.idCombustivel != other.idCombustivel) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.systemcar.model.PostoCombustivelPK[ idPosto=" + idPosto + ", idCombustivel=" + idCombustivel + " ]";
    }
    
}
